package com.yhc.user.server.controller;

import com.yhc.common.dto.BaseResult;
import com.yhc.common.util.ResultUtil;
import com.yhc.user.api.UserApi;
import com.yhc.user.api.request.BuyGoodsRequest;
import com.yhc.user.server.service.IUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class UserController implements UserApi {

    @Autowired
    IUserService userService;


    @Override
    public BaseResult<String> login(Long id) {
        return ResultUtil.ok(userService.login(id));
    }

    @Override
    public BaseResult<?> buy(BuyGoodsRequest request) {
        userService.buy(request);
        return ResultUtil.ok();
    }
}
